﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace NJL.WebUsers.Controls
{
    public partial class WUCLoginBox : BaseUserControl
    {
        private readonly BLL.NJL_ATTRACTION bllAttraction = new BLL.NJL_ATTRACTION();
        private readonly BLL.NJL_COMPANY bllCompany = new BLL.NJL_COMPANY();
        private readonly BLL.NJL_CS_AREA bllArea = new BLL.NJL_CS_AREA();
        private readonly BLL.NJL_USER bllUser = new BLL.NJL_USER();
        private readonly BLL.NJL_LOCAL_COLOR bllLocalColor = new BLL.NJL_LOCAL_COLOR();

        protected int PROVINCE_COUNT = 0;
        protected int CITY_COUNT = 0;
        protected int COMPANY_COUNT = 0;
        protected int USER_COUNT = 0;
        protected int LOCAL_COLOR_COUNT = 0;
        protected int ATTRACTION_COUNT = 0;

        protected void Page_Load(object sender, EventArgs e)
        {
            //PROVINCE_COUNT = bllArea.GetModelList(" deep=1 ").Count;
            CITY_COUNT = bllArea.GetModelList(" deep=2 and AREA_CODE like '" + WEBSITE_CODE.Substring(0, 2) + "%' ").Count;
            COMPANY_COUNT = bllCompany.GetListCount(" NJL_COMPANY.NJL_SYS_BASE_ID='" + WEBSITE_CODE + "' ");
            //USER_COUNT = bllUser.GetModelList(" NJL_SYS_BASE_ID='" + WEBSITE_CODE + "' ").Count;
            USER_COUNT = bllUser.GetModelList(" ").Count;
            LOCAL_COLOR_COUNT = bllLocalColor.GetModelList(" NJL_LOCAL_COLOR.NJL_SYS_BASE_ID='" + WEBSITE_CODE + "' ").Count;
            ATTRACTION_COUNT = bllAttraction.GetModelList(" NJL_ATTRACTION.NJL_SYS_BASE_ID='" + WEBSITE_CODE + "' ").Count;
        }
    }
}